<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8"/>
    <title>每日特惠</title>
    <link th:href="@{css/fonts.css}" rel="stylesheet"/>
    <style>
        body {
            background-color: #1A2332;
            color: #E0E0E0;
            margin: 0;
            padding: 20px;
            line-height: 1.6;
            -fs-pdf-font-embed: embed;
        }

        .card {
            background-color: #2D3B4D;
            border-radius: 12px;
            border: 2px solid #3C4B5E;
            padding: 25px;
            max-width: 600px;
            margin: 0 auto;
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        }

        h1 {
            color: #4EC0FB;
            font-size: 28px;
            margin-bottom: 20px;
            text-align: center;
        }

        table {
            width: 100%;
            border-collapse: separate;
            border-spacing: 0 10px;
        }

        td {
            padding: 10px;
            font-size: 16px;
        }

        td:first-child {
            color: #A0B1C5;
            width: 30%;
        }

        td:last-child {
            color: #FFD700;
            font-weight: bold;
        }

        .discount {
            color: #FF6B6B;
        }

        .remaining {
            color: #4CAF50;
        }
    </style>
</head>
<body>
<w>1290</w>
<div class="card" th:each="d:${deals}">
    <h1>每日特惠</h1>
    <table>
        <tr>
            <td>物品名称：</td>
            <td th:text="${d.item}"></td>
        </tr>
        <tr>
            <td>原价/现价：</td>
            <td>
                <span th:text="${d.originalPrice}" style="text-decoration: line-through;"></span>
                <span> / </span>
                <span th:text="${d.salePrice}" style="color: #4CAF50;"></span>
            </td>
        </tr>
        <tr>
            <td>折扣比：</td>
            <td class="discount" th:text="${d.count} + ' %'"></td>
        </tr>
        <tr>
            <td>总/余：</td>
            <td>
                <span th:text="${d.total}"></span>
                <span> / </span>
                <span class="remaining" th:text="${d.total} == ${d.sold} ? '0' : ${d.sold}"></span>
            </td>
        </tr>
        <tr>
            <td>剩余时间：</td>
            <td th:text="${d.getTimeLeft()}"></td>
        </tr>
    </table>
</div>
</body>
</html>